import axios, { AxiosRequestConfig } from 'axios'

import { IDeliveryDetails } from './interface'
import './__mock__'

/** 获取亚马逊信息 */
export const apiGetAmazonInfo = async (
  waybillNo: string,
  signal?: AxiosRequestConfig['signal'],
): Promise<IDeliveryDetails> => {
  return axios
    .post(`/tmsapi/track_waybill/getAmazonInfo`, { waybillNo }, { $extra: 'noAuth', signal })
    .then(res => res.$data)
}
